package com.five.vo;

import com.sun.org.apache.bcel.internal.classfile.Code;

/**
 * @author: star
 * @Date: 2021-05-18 20:09
 */
public class BaseResultVO<T> {

    private int code = Code.SUCCESS.getValue();
    private String message;
    private T data;

    /**
     *     业务处理状态枚举
     *     NOT_LOGIN(登录失效或没有登录)
     * @return
     */
    public enum Code {
        SUCCESS(0), FAILED(-1), BUSINESS_EXCEPTIONS(100), NOT_LOGIN(-2), IS_COLLECTION(-3);
        private int value;

        Code(int value) {
            this.value = value;
        }

        public int getValue() {
            return value;
        }
    }

    @Override
    public String toString() {
        return "BaseResultVO{" +
                "code=" + code +
                ", message='" + message + '\'' +
                ", data=" + data +
                '}';
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
